package com.kfit.java8.stream;

import java.util.Arrays;

public class Test7 {
	public static void main(String[] args) {
		Integer[] nums = {2,3,5,6,7,9,8};
		
		//是否有存在偶数.
		boolean isEven = Arrays.stream(nums).anyMatch(n->n%2==0);
		//结果：isEven=true
		System.out.println("isEven="+isEven);
		
		//是否全部是偶数.
		boolean isEvenAll = Arrays.stream(nums).allMatch(n->n%2==0);
		//结果：isEvenAll=false
		System.out.println("isEvenAll="+isEvenAll);
		
		//是否全部不是偶数
		boolean noneMatch = Arrays.stream(nums).noneMatch(n->n%2==0);
		//结果：noneMatch=false
		System.out.println("noneMatch="+noneMatch);
	}
	
	
}
